//
//  VipCardReportSectionFootView.m
//  fitnessmanage
//
//  Created by wujian on 2018/1/2.
//  Copyright © 2018年 zongquankeji. All rights reserved.
//

#import "VipCardReportSectionFootView.h"

@implementation VipCardReportSectionFootView

-(id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.backgroundColor = CSWhiteColor;
        
        /**
         类型Label
         */
        UILabel *typeLabel = [[UILabel alloc] init];
        typeLabel.font = MidBigFont;
        typeLabel.textColor = CSColorFromRGB(0x666666);
        typeLabel.textAlignment = NSTextAlignmentCenter;
        typeLabel.text = @"合计";
        [self addSubview:typeLabel];
        self.typeLabel = typeLabel;
        
        /**
         节数
         */
        UILabel *countLabel = [[UILabel alloc] init];
        countLabel.text = @"2笔";
        countLabel.font = MidBigFont;
        countLabel.textColor = CSColorFromRGB(0x666666);
        countLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:countLabel];
        self.countLabel = countLabel;
        
        /**
         应收
         */
        UILabel *netReceiptLabel = [[UILabel alloc] init];
        netReceiptLabel.text = @"--";
        netReceiptLabel.font = MidBigFont;
        netReceiptLabel.textColor = CSColorFromRGB(0x666666);
        netReceiptLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:netReceiptLabel];
        self.netReceiptLabel = netReceiptLabel;
        
        /**
         实收
         */
        UILabel *receiveLabel = [[UILabel alloc] init];
        receiveLabel.text = @"--";
        receiveLabel.font = MidBigFont;
        receiveLabel.textColor = CSColorFromRGB(0x666666);
        receiveLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:receiveLabel];
        self.receiveLabel = receiveLabel;
        
        UIView *lineView = [[UIView alloc] init];
        lineView.backgroundColor = BackGroundColor;
        [self addSubview:lineView];
        self.lineView = lineView;
        
        [self setConstraints];
        
    }
    
    return self;
}

#pragma mark 设置约束
-(void)setConstraints{
    
    
    [self.lineView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.width.top.mas_equalTo(self);
        
        make.height.mas_equalTo(10);
    }];
    
    /**
     类型Label
     */
    [self.typeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self);
        
        make.top.mas_equalTo(self.lineView.mas_bottom).offset(10);
        
        make.bottom.mas_equalTo(self).offset(-10);
    }];
    
    [self.countLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.typeLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
    }];
    
    /**
     应收
     */
    [self.netReceiptLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.countLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
        
    }];
    
    /**
     实收
     */
    [self.receiveLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.netReceiptLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
        
        make.right.mas_equalTo(self);
    }];
    
}

@end
